# https://docs.python.org/zh-cn/3/library/typing.html
from typing import List

class Solution:
    def removeDuplicates(self, nums: List[int]) -> int:
        indexh, indext, listlen = 0, 1, len(nums)
        while indext < listlen:
            if nums[indexh] != nums[indext]:
                indexh += 1
                nums[indexh] = nums[indext]
            indext += 1
        return indexh + 1


solution = Solution()

nums1 = [1,1,2]
print(nums1)
print(solution.removeDuplicates(nums1))
print(nums1)

nums2 = [0,0,1,1,1,2,2,3,3,4]
print(nums2)
print(solution.removeDuplicates(nums2))
print(nums2)